{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": [
    "# Period Views\n",
    "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](http://colab.research.google.com/github/dgunning/edgartools/blob/main/notebooks/XBRL2-PeriodViews.ipynb)"
   ],
   "id": "3d4b9dd4e8cd2e72"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:35:08.628665Z",
     "start_time": "2025-03-16T18:35:08.626672Z"
    }
   },
   "cell_type": "code",
   "source": "#! pip install -U edgartools",
   "id": "3447d1b8de1acbd1",
   "outputs": [],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:46:07.930027Z",
     "start_time": "2025-03-16T18:46:07.925431Z"
    }
   },
   "cell_type": "code",
   "source": [
    "from edgar import *\n",
    "\n",
    "set_identity('periodviews@testing.net')"
   ],
   "id": "fc4b2fc8a2f2efe6",
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:46:20.831191Z",
     "start_time": "2025-03-16T18:46:20.811500Z"
    }
   },
   "cell_type": "code",
   "source": "from edgar.xbrl import *",
   "id": "d3839727767baa27",
   "outputs": [],
   "execution_count": 4
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "## Get the latest filings",
   "id": "306314bb99bb15af"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:51:52.798873Z",
     "start_time": "2025-03-16T18:51:51.210650Z"
    }
   },
   "cell_type": "code",
   "source": [
    "def get_xbrl(ticker:str):\n",
    "    c = Company(ticker)\n",
    "    filing = c.latest(\"10-K\")\n",
    "    xbrl = XBRL.from_filing(filing)\n",
    "    return xbrl\n",
    "\n",
    "aapl_xbrl = get_xbrl(\"AAPL\")\n",
    "intc_xbrl = get_xbrl(\"INTC\")"
   ],
   "id": "7bde1c3c0fdb958b",
   "outputs": [],
   "execution_count": 9
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "## Compare Period Views",
   "id": "a4906c9ec154aa62"
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "### AAPL",
   "id": "7aef1c18ab2bb12b"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:56:12.578598Z",
     "start_time": "2025-03-16T18:56:12.574929Z"
    }
   },
   "cell_type": "code",
   "source": "aapl_xbrl.get_period_views(\"IncomeStatement\")",
   "id": "1d65fee8e55c100c",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'name': 'Three-Year Comparison',\n",
       "  'description': 'Compares three fiscal years',\n",
       "  'period_keys': ['duration_2023-10-01_2024-09-28',\n",
       "   'duration_2022-09-25_2023-09-30',\n",
       "   'duration_2021-09-26_2022-09-24']},\n",
       " {'name': 'Annual Comparison',\n",
       "  'description': 'Compares recent fiscal years',\n",
       "  'period_keys': ['duration_2023-10-01_2024-09-28',\n",
       "   'duration_2022-09-25_2023-09-30']}]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 13
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T19:45:59.346972Z",
     "start_time": "2025-03-16T19:45:59.326947Z"
    }
   },
   "cell_type": "code",
   "source": "aapl_xbrl.render_statement(\"IncomeStatement\")",
   "id": "8940b5498f8ee553",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001B[3m                                CONSOLIDATEDSTATEMENTSOFOPERATIONS                                 \u001B[0m\n",
       "\u001B[3m                       \u001B[0m\u001B[1;3mYear Ended\u001B[0m\u001B[3m \u001B[0m\u001B[3m(In millions, except shares in thousands)\u001B[0m\u001B[3m                        \u001B[0m\n",
       "                                                                                                   \n",
       " \u001B[1m \u001B[0m\u001B[1mLine Item                                         \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mSep 28, 2024\u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mSep 30, 2023\u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mSep 24, 2022\u001B[0m\u001B[1m \u001B[0m \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "        Net sales                                          $391,035       $383,285       $394,328  \n",
       "        Cost of sales                                      $210,352       $214,137       $223,546  \n",
       "        Gross margin                                       $180,683       $169,148       $170,782  \n",
       "        Operating expenses:                                                                        \n",
       "          Research and development                          $31,370        $29,915        $26,251  \n",
       "          Selling, general and administrative               $26,097        $24,932        $25,094  \n",
       "          Total operating expenses                          $57,467        $54,847        $51,345  \n",
       "        Operating income                                   $123,216       $114,301       $119,437  \n",
       "        Other income/(expense), net                            $269         $(565)         $(334)  \n",
       "        Income before provision for income taxes           $123,485       $113,736       $119,103  \n",
       "        Provision for income taxes                          $29,749        $16,741        $19,300  \n",
       "        Net income                                          $93,736        $96,995        $99,803  \n",
       "        Earnings per share:                                                                        \n",
       "          Basic (in dollars per share)                         0.00           0.00           0.00  \n",
       "          Diluted (in dollars per share)                       0.00           0.00           0.00  \n",
       "        Shares used in computing earnings per share:                                               \n",
       "          Basic (in shares)                              15,343,783     15,744,231     16,215,963  \n",
       "          Diluted (in shares)                            15,408,095     15,812,547     16,325,819  \n",
       "                                                                                                   \n"
      ],
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                                CONSOLIDATEDSTATEMENTSOFOPERATIONS                                 </span>\n",
       "<span style=\"font-style: italic\">                       </span><span style=\"font-weight: bold; font-style: italic\">Year Ended</span><span style=\"font-style: italic\"> (In millions, except shares in thousands)                        </span>\n",
       "                                                                                                   \n",
       " <span style=\"font-weight: bold\"> Line Item                                          </span> <span style=\"font-weight: bold\"> Sep 28, 2024 </span> <span style=\"font-weight: bold\"> Sep 30, 2023 </span> <span style=\"font-weight: bold\"> Sep 24, 2022 </span> \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "        Net sales                                          $391,035       $383,285       $394,328  \n",
       "        Cost of sales                                      $210,352       $214,137       $223,546  \n",
       "        Gross margin                                       $180,683       $169,148       $170,782  \n",
       "        Operating expenses:                                                                        \n",
       "          Research and development                          $31,370        $29,915        $26,251  \n",
       "          Selling, general and administrative               $26,097        $24,932        $25,094  \n",
       "          Total operating expenses                          $57,467        $54,847        $51,345  \n",
       "        Operating income                                   $123,216       $114,301       $119,437  \n",
       "        Other income/(expense), net                            $269         $(565)         $(334)  \n",
       "        Income before provision for income taxes           $123,485       $113,736       $119,103  \n",
       "        Provision for income taxes                          $29,749        $16,741        $19,300  \n",
       "        Net income                                          $93,736        $96,995        $99,803  \n",
       "        Earnings per share:                                                                        \n",
       "          Basic (in dollars per share)                         0.00           0.00           0.00  \n",
       "          Diluted (in dollars per share)                       0.00           0.00           0.00  \n",
       "        Shares used in computing earnings per share:                                               \n",
       "          Basic (in shares)                              15,343,783     15,744,231     16,215,963  \n",
       "          Diluted (in shares)                            15,408,095     15,812,547     16,325,819  \n",
       "                                                                                                   \n",
       "</pre>\n"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 22
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:57:27.394909Z",
     "start_time": "2025-03-16T18:57:27.377150Z"
    }
   },
   "cell_type": "code",
   "source": "aapl_xbrl.render_statement(\"IncomeStatement\", period_view=\"Three-Year Comparison\")",
   "id": "d313a211267ce386",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001B[3m                                        CONSOLIDATEDSTATEMENTSOFOPERATIONS                                         \u001B[0m\n",
       "\u001B[3m                               \u001B[0m\u001B[1;3mYear Ended\u001B[0m\u001B[3m \u001B[0m\u001B[3m(In millions, except shares in thousands)\u001B[0m\u001B[3m                                \u001B[0m\n",
       "                                                                                                                   \n",
       " \u001B[1m                            \u001B[0m \u001B[1m                           \u001B[0m \u001B[1m                            \u001B[0m \u001B[1m \u001B[0m\u001B[1mAnnual: September 26,    \u001B[0m\u001B[1m \u001B[0m \n",
       " \u001B[1m                            \u001B[0m \u001B[1m \u001B[0m\u001B[1mAnnual: October 01, 2023 \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mAnnual: September 25, 2022\u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1m2021 to September 24,    \u001B[0m\u001B[1m \u001B[0m \n",
       " \u001B[1m \u001B[0m\u001B[1mLine Item                 \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mto September 28, 2024    \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mto September 30, 2023     \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1m2022                     \u001B[0m\u001B[1m \u001B[0m \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "        Net sales                               $391,035                     $383,285                    $394,328  \n",
       "        Cost of sales                           $210,352                     $214,137                    $223,546  \n",
       "        Gross margin                            $180,683                     $169,148                    $170,782  \n",
       "        Operating expenses:                                                                                        \n",
       "          Research and                           $31,370                      $29,915                     $26,251  \n",
       "  development                                                                                                      \n",
       "          Selling, general                       $26,097                      $24,932                     $25,094  \n",
       "  and administrative                                                                                               \n",
       "          Total operating                        $57,467                      $54,847                     $51,345  \n",
       "  expenses                                                                                                         \n",
       "        Operating income                        $123,216                     $114,301                    $119,437  \n",
       "        Other                                       $269                       $(565)                      $(334)  \n",
       "  income/(expense), net                                                                                            \n",
       "        Income before                           $123,485                     $113,736                    $119,103  \n",
       "  provision for income taxes                                                                                       \n",
       "        Provision for income                     $29,749                      $16,741                     $19,300  \n",
       "  taxes                                                                                                            \n",
       "        Net income                               $93,736                      $96,995                     $99,803  \n",
       "        Earnings per share:                                                                                        \n",
       "          Basic (in dollars                         0.00                         0.00                        0.00  \n",
       "  per share)                                                                                                       \n",
       "          Diluted (in                               0.00                         0.00                        0.00  \n",
       "  dollars per share)                                                                                               \n",
       "        Shares used in                                                                                             \n",
       "  computing earnings per                                                                                           \n",
       "  share:                                                                                                           \n",
       "          Basic (in shares)                   15,343,783                   15,744,231                  16,215,963  \n",
       "          Diluted (in                         15,408,095                   15,812,547                  16,325,819  \n",
       "  shares)                                                                                                          \n",
       "                                                                                                                   \n"
      ],
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                                        CONSOLIDATEDSTATEMENTSOFOPERATIONS                                         </span>\n",
       "<span style=\"font-style: italic\">                               </span><span style=\"font-weight: bold; font-style: italic\">Year Ended</span><span style=\"font-style: italic\"> (In millions, except shares in thousands)                                </span>\n",
       "                                                                                                                   \n",
       " <span style=\"font-weight: bold\">                            </span> <span style=\"font-weight: bold\">                           </span> <span style=\"font-weight: bold\">                            </span> <span style=\"font-weight: bold\"> Annual: September 26,     </span> \n",
       " <span style=\"font-weight: bold\">                            </span> <span style=\"font-weight: bold\"> Annual: October 01, 2023  </span> <span style=\"font-weight: bold\"> Annual: September 25, 2022 </span> <span style=\"font-weight: bold\"> 2021 to September 24,     </span> \n",
       " <span style=\"font-weight: bold\"> Line Item                  </span> <span style=\"font-weight: bold\"> to September 28, 2024     </span> <span style=\"font-weight: bold\"> to September 30, 2023      </span> <span style=\"font-weight: bold\"> 2022                      </span> \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "        Net sales                               $391,035                     $383,285                    $394,328  \n",
       "        Cost of sales                           $210,352                     $214,137                    $223,546  \n",
       "        Gross margin                            $180,683                     $169,148                    $170,782  \n",
       "        Operating expenses:                                                                                        \n",
       "          Research and                           $31,370                      $29,915                     $26,251  \n",
       "  development                                                                                                      \n",
       "          Selling, general                       $26,097                      $24,932                     $25,094  \n",
       "  and administrative                                                                                               \n",
       "          Total operating                        $57,467                      $54,847                     $51,345  \n",
       "  expenses                                                                                                         \n",
       "        Operating income                        $123,216                     $114,301                    $119,437  \n",
       "        Other                                       $269                       $(565)                      $(334)  \n",
       "  income/(expense), net                                                                                            \n",
       "        Income before                           $123,485                     $113,736                    $119,103  \n",
       "  provision for income taxes                                                                                       \n",
       "        Provision for income                     $29,749                      $16,741                     $19,300  \n",
       "  taxes                                                                                                            \n",
       "        Net income                               $93,736                      $96,995                     $99,803  \n",
       "        Earnings per share:                                                                                        \n",
       "          Basic (in dollars                         0.00                         0.00                        0.00  \n",
       "  per share)                                                                                                       \n",
       "          Diluted (in                               0.00                         0.00                        0.00  \n",
       "  dollars per share)                                                                                               \n",
       "        Shares used in                                                                                             \n",
       "  computing earnings per                                                                                           \n",
       "  share:                                                                                                           \n",
       "          Basic (in shares)                   15,343,783                   15,744,231                  16,215,963  \n",
       "          Diluted (in                         15,408,095                   15,812,547                  16,325,819  \n",
       "  shares)                                                                                                          \n",
       "                                                                                                                   \n",
       "</pre>\n"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 15
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:58:08.510956Z",
     "start_time": "2025-03-16T18:58:08.494549Z"
    }
   },
   "cell_type": "code",
   "source": "aapl_xbrl.render_statement(\"IncomeStatement\", period_view=\"Annual Comparison\")",
   "id": "b0cbd486c117e450",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001B[3m                                        CONSOLIDATEDSTATEMENTSOFOPERATIONS                                         \u001B[0m\n",
       "\u001B[3m                               \u001B[0m\u001B[1;3mYear Ended\u001B[0m\u001B[3m \u001B[0m\u001B[3m(In millions, except shares in thousands)\u001B[0m\u001B[3m                                \u001B[0m\n",
       "                                                                                                                   \n",
       " \u001B[1m                                     \u001B[0m \u001B[1m \u001B[0m\u001B[1mAnnual: October 01, 2023 to        \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mAnnual: September 25, 2022 to      \u001B[0m\u001B[1m \u001B[0m \n",
       " \u001B[1m \u001B[0m\u001B[1mLine Item                          \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mSeptember 28, 2024                 \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mSeptember 30, 2023                 \u001B[0m\u001B[1m \u001B[0m \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "        Net sales                                                  $391,035                              $383,285  \n",
       "        Cost of sales                                              $210,352                              $214,137  \n",
       "        Gross margin                                               $180,683                              $169,148  \n",
       "        Operating expenses:                                                                                        \n",
       "          Research and development                                  $31,370                               $29,915  \n",
       "          Selling, general and                                      $26,097                               $24,932  \n",
       "  administrative                                                                                                   \n",
       "          Total operating expenses                                  $57,467                               $54,847  \n",
       "        Operating income                                           $123,216                              $114,301  \n",
       "        Other income/(expense), net                                    $269                                $(565)  \n",
       "        Income before provision for                                $123,485                              $113,736  \n",
       "  income taxes                                                                                                     \n",
       "        Provision for income taxes                                  $29,749                               $16,741  \n",
       "        Net income                                                  $93,736                               $96,995  \n",
       "        Earnings per share:                                                                                        \n",
       "          Basic (in dollars per                                        0.00                                  0.00  \n",
       "  share)                                                                                                           \n",
       "          Diluted (in dollars per                                      0.00                                  0.00  \n",
       "  share)                                                                                                           \n",
       "        Shares used in computing                                                                                   \n",
       "  earnings per share:                                                                                              \n",
       "          Basic (in shares)                                      15,343,783                            15,744,231  \n",
       "          Diluted (in shares)                                    15,408,095                            15,812,547  \n",
       "                                                                                                                   \n"
      ],
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                                        CONSOLIDATEDSTATEMENTSOFOPERATIONS                                         </span>\n",
       "<span style=\"font-style: italic\">                               </span><span style=\"font-weight: bold; font-style: italic\">Year Ended</span><span style=\"font-style: italic\"> (In millions, except shares in thousands)                                </span>\n",
       "                                                                                                                   \n",
       " <span style=\"font-weight: bold\">                                     </span> <span style=\"font-weight: bold\"> Annual: October 01, 2023 to         </span> <span style=\"font-weight: bold\"> Annual: September 25, 2022 to       </span> \n",
       " <span style=\"font-weight: bold\"> Line Item                           </span> <span style=\"font-weight: bold\"> September 28, 2024                  </span> <span style=\"font-weight: bold\"> September 30, 2023                  </span> \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "        Net sales                                                  $391,035                              $383,285  \n",
       "        Cost of sales                                              $210,352                              $214,137  \n",
       "        Gross margin                                               $180,683                              $169,148  \n",
       "        Operating expenses:                                                                                        \n",
       "          Research and development                                  $31,370                               $29,915  \n",
       "          Selling, general and                                      $26,097                               $24,932  \n",
       "  administrative                                                                                                   \n",
       "          Total operating expenses                                  $57,467                               $54,847  \n",
       "        Operating income                                           $123,216                              $114,301  \n",
       "        Other income/(expense), net                                    $269                                $(565)  \n",
       "        Income before provision for                                $123,485                              $113,736  \n",
       "  income taxes                                                                                                     \n",
       "        Provision for income taxes                                  $29,749                               $16,741  \n",
       "        Net income                                                  $93,736                               $96,995  \n",
       "        Earnings per share:                                                                                        \n",
       "          Basic (in dollars per                                        0.00                                  0.00  \n",
       "  share)                                                                                                           \n",
       "          Diluted (in dollars per                                      0.00                                  0.00  \n",
       "  share)                                                                                                           \n",
       "        Shares used in computing                                                                                   \n",
       "  earnings per share:                                                                                              \n",
       "          Basic (in shares)                                      15,343,783                            15,744,231  \n",
       "          Diluted (in shares)                                    15,408,095                            15,812,547  \n",
       "                                                                                                                   \n",
       "</pre>\n"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 16
  },
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": "### INTC",
   "id": "871303c525ef6a63"
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T18:53:09.275850Z",
     "start_time": "2025-03-16T18:53:09.272152Z"
    }
   },
   "cell_type": "code",
   "source": "intc_xbrl.get_period_views(\"IncomeStatement\")",
   "id": "994d25ff357b9ee4",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'name': 'Three-Year Comparison',\n",
       "  'description': 'Compares three fiscal years',\n",
       "  'period_keys': ['duration_2023-12-31_2024-12-28',\n",
       "   'duration_2023-01-01_2023-12-30',\n",
       "   'duration_2021-12-26_2022-12-31']},\n",
       " {'name': 'Annual Comparison',\n",
       "  'description': 'Compares recent fiscal years',\n",
       "  'period_keys': ['duration_2023-12-31_2024-12-28',\n",
       "   'duration_2023-01-01_2023-12-30']},\n",
       " {'name': 'Three Recent Quarters',\n",
       "  'description': 'Shows three most recent quarters in sequence',\n",
       "  'period_keys': ['duration_2024-09-29_2024-12-28',\n",
       "   'duration_2024-03-31_2024-06-29',\n",
       "   'duration_2023-12-31_2024-03-30']},\n",
       " {'name': 'YTD and Quarterly Breakdown',\n",
       "  'description': 'Shows YTD figures and quarterly breakdown',\n",
       "  'period_keys': ['duration_2023-12-31_2024-09-28',\n",
       "   'duration_2024-09-29_2024-12-28',\n",
       "   'duration_2024-03-31_2024-06-29',\n",
       "   'duration_2023-12-31_2024-03-30']}]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 11
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T19:42:33.767456Z",
     "start_time": "2025-03-16T19:42:33.734809Z"
    }
   },
   "cell_type": "code",
   "source": "intc_xbrl.render_statement(\"IncomeStatement\")",
   "id": "e5c177275d0e96d2",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001B[3m                                          ConsolidatedStatementsofIncome                                           \u001B[0m\n",
       "\u001B[3m                                  \u001B[0m\u001B[1;3mYear Ended\u001B[0m\u001B[3m \u001B[0m\u001B[3m(In millions, except per share data)\u001B[0m\u001B[3m                                  \u001B[0m\n",
       "                                                                                                                   \n",
       " \u001B[1m \u001B[0m\u001B[1mLine Item                                                         \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mDec 28, 2024\u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mDec 30, 2023\u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mDec 31, 2022\u001B[0m\u001B[1m \u001B[0m \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                             $53,101        $54,228        $63,054  \n",
       "    Cost of sales                                                           $35,756        $32,517        $36,188  \n",
       "    Gross margin                                                            $17,345        $21,711        $26,866  \n",
       "    Research and development                                                $16,546        $16,046        $17,528  \n",
       "    Marketing, general, and administrative                                   $5,507         $5,634         $7,002  \n",
       "    Restructuring and other charges                                          $6,970          $(62)             $2  \n",
       "    Operating expenses                                                      $29,023        $21,618        $24,532  \n",
       "    Operating income (loss)                                               $(11,678)            $93         $2,334  \n",
       "    Gains (losses) on equity investments, net                                  $242            $40         $4,268  \n",
       "    Interest and other, net                                                    $226           $629         $1,166  \n",
       "    Income (loss) before taxes                                            $(11,210)           $762         $7,768  \n",
       "    Provision for (benefit from) taxes                                       $8,023         $(913)         $(249)  \n",
       "    Net income (loss)                                                     $(19,233)         $1,675         $8,017  \n",
       "    Less: net income (loss) attributable to non-controlling                  $(477)          $(14)             $3  \n",
       "  interests                                                                                                        \n",
       "    Net income (loss) attributable to Intel                               $(18,756)         $1,689         $8,014  \n",
       "    Earnings (loss) per share attributable to Intel—basic                    (0.00)           0.00           0.00  \n",
       "    Earnings (loss) per share attributable to Intel—diluted                  (0.00)           0.00           0.00  \n",
       "    Weighted average shares of common stock outstanding:                                                           \n",
       "      Basic (shares)                                                          4,280          4,190          4,108  \n",
       "      Diluted (shares)                                                        4,280          4,212          4,123  \n",
       "                                                                                                                   \n"
      ],
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                                          ConsolidatedStatementsofIncome                                           </span>\n",
       "<span style=\"font-style: italic\">                                  </span><span style=\"font-weight: bold; font-style: italic\">Year Ended</span><span style=\"font-style: italic\"> (In millions, except per share data)                                  </span>\n",
       "                                                                                                                   \n",
       " <span style=\"font-weight: bold\"> Line Item                                                          </span> <span style=\"font-weight: bold\"> Dec 28, 2024 </span> <span style=\"font-weight: bold\"> Dec 30, 2023 </span> <span style=\"font-weight: bold\"> Dec 31, 2022 </span> \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                             $53,101        $54,228        $63,054  \n",
       "    Cost of sales                                                           $35,756        $32,517        $36,188  \n",
       "    Gross margin                                                            $17,345        $21,711        $26,866  \n",
       "    Research and development                                                $16,546        $16,046        $17,528  \n",
       "    Marketing, general, and administrative                                   $5,507         $5,634         $7,002  \n",
       "    Restructuring and other charges                                          $6,970          $(62)             $2  \n",
       "    Operating expenses                                                      $29,023        $21,618        $24,532  \n",
       "    Operating income (loss)                                               $(11,678)            $93         $2,334  \n",
       "    Gains (losses) on equity investments, net                                  $242            $40         $4,268  \n",
       "    Interest and other, net                                                    $226           $629         $1,166  \n",
       "    Income (loss) before taxes                                            $(11,210)           $762         $7,768  \n",
       "    Provision for (benefit from) taxes                                       $8,023         $(913)         $(249)  \n",
       "    Net income (loss)                                                     $(19,233)         $1,675         $8,017  \n",
       "    Less: net income (loss) attributable to non-controlling                  $(477)          $(14)             $3  \n",
       "  interests                                                                                                        \n",
       "    Net income (loss) attributable to Intel                               $(18,756)         $1,689         $8,014  \n",
       "    Earnings (loss) per share attributable to Intel—basic                    (0.00)           0.00           0.00  \n",
       "    Earnings (loss) per share attributable to Intel—diluted                  (0.00)           0.00           0.00  \n",
       "    Weighted average shares of common stock outstanding:                                                           \n",
       "      Basic (shares)                                                          4,280          4,190          4,108  \n",
       "      Diluted (shares)                                                        4,280          4,212          4,123  \n",
       "                                                                                                                   \n",
       "</pre>\n"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 20
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T19:41:31.052873Z",
     "start_time": "2025-03-16T19:41:31.021764Z"
    }
   },
   "cell_type": "code",
   "source": "intc_xbrl.render_statement(\"IncomeStatement\", period_view=\"Annual Comparison\")",
   "id": "64b26fd6685619de",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001B[3m                                          ConsolidatedStatementsofIncome                                           \u001B[0m\n",
       "\u001B[3m                                  \u001B[0m\u001B[1;3mYear Ended\u001B[0m\u001B[3m \u001B[0m\u001B[3m(In millions, except per share data)\u001B[0m\u001B[3m                                  \u001B[0m\n",
       "                                                                                                                   \n",
       " \u001B[1m                                     \u001B[0m \u001B[1m \u001B[0m\u001B[1mAnnual: December 31, 2023 to       \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mAnnual: January 01, 2023 to        \u001B[0m\u001B[1m \u001B[0m \n",
       " \u001B[1m \u001B[0m\u001B[1mLine Item                          \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mDecember 28, 2024                  \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mDecember 30, 2023                  \u001B[0m\u001B[1m \u001B[0m \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                     $53,101                               $54,228  \n",
       "    Cost of sales                                                   $35,756                               $32,517  \n",
       "    Gross margin                                                    $17,345                               $21,711  \n",
       "    Research and development                                        $16,546                               $16,046  \n",
       "    Marketing, general, and                                          $5,507                                $5,634  \n",
       "  administrative                                                                                                   \n",
       "    Restructuring and other charges                                  $6,970                                 $(62)  \n",
       "    Operating expenses                                              $29,023                               $21,618  \n",
       "    Operating income (loss)                                       $(11,678)                                   $93  \n",
       "    Gains (losses) on equity                                           $242                                   $40  \n",
       "  investments, net                                                                                                 \n",
       "    Interest and other, net                                            $226                                  $629  \n",
       "    Income (loss) before taxes                                    $(11,210)                                  $762  \n",
       "    Provision for (benefit from)                                     $8,023                                $(913)  \n",
       "  taxes                                                                                                            \n",
       "    Net income (loss)                                             $(19,233)                                $1,675  \n",
       "    Less: net income (loss)                                          $(477)                                 $(14)  \n",
       "  attributable to non-controlling                                                                                  \n",
       "  interests                                                                                                        \n",
       "    Net income (loss) attributable to                             $(18,756)                                $1,689  \n",
       "  Intel                                                                                                            \n",
       "    Earnings (loss) per share                                        (0.00)                                  0.00  \n",
       "  attributable to Intel—basic                                                                                      \n",
       "    Earnings (loss) per share                                        (0.00)                                  0.00  \n",
       "  attributable to Intel—diluted                                                                                    \n",
       "    Weighted average shares of common                                                                              \n",
       "  stock outstanding:                                                                                               \n",
       "      Basic (shares)                                                  4,280                                 4,190  \n",
       "      Diluted (shares)                                                4,280                                 4,212  \n",
       "                                                                                                                   \n"
      ],
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                                          ConsolidatedStatementsofIncome                                           </span>\n",
       "<span style=\"font-style: italic\">                                  </span><span style=\"font-weight: bold; font-style: italic\">Year Ended</span><span style=\"font-style: italic\"> (In millions, except per share data)                                  </span>\n",
       "                                                                                                                   \n",
       " <span style=\"font-weight: bold\">                                     </span> <span style=\"font-weight: bold\"> Annual: December 31, 2023 to        </span> <span style=\"font-weight: bold\"> Annual: January 01, 2023 to         </span> \n",
       " <span style=\"font-weight: bold\"> Line Item                           </span> <span style=\"font-weight: bold\"> December 28, 2024                   </span> <span style=\"font-weight: bold\"> December 30, 2023                   </span> \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                     $53,101                               $54,228  \n",
       "    Cost of sales                                                   $35,756                               $32,517  \n",
       "    Gross margin                                                    $17,345                               $21,711  \n",
       "    Research and development                                        $16,546                               $16,046  \n",
       "    Marketing, general, and                                          $5,507                                $5,634  \n",
       "  administrative                                                                                                   \n",
       "    Restructuring and other charges                                  $6,970                                 $(62)  \n",
       "    Operating expenses                                              $29,023                               $21,618  \n",
       "    Operating income (loss)                                       $(11,678)                                   $93  \n",
       "    Gains (losses) on equity                                           $242                                   $40  \n",
       "  investments, net                                                                                                 \n",
       "    Interest and other, net                                            $226                                  $629  \n",
       "    Income (loss) before taxes                                    $(11,210)                                  $762  \n",
       "    Provision for (benefit from)                                     $8,023                                $(913)  \n",
       "  taxes                                                                                                            \n",
       "    Net income (loss)                                             $(19,233)                                $1,675  \n",
       "    Less: net income (loss)                                          $(477)                                 $(14)  \n",
       "  attributable to non-controlling                                                                                  \n",
       "  interests                                                                                                        \n",
       "    Net income (loss) attributable to                             $(18,756)                                $1,689  \n",
       "  Intel                                                                                                            \n",
       "    Earnings (loss) per share                                        (0.00)                                  0.00  \n",
       "  attributable to Intel—basic                                                                                      \n",
       "    Earnings (loss) per share                                        (0.00)                                  0.00  \n",
       "  attributable to Intel—diluted                                                                                    \n",
       "    Weighted average shares of common                                                                              \n",
       "  stock outstanding:                                                                                               \n",
       "      Basic (shares)                                                  4,280                                 4,190  \n",
       "      Diluted (shares)                                                4,280                                 4,212  \n",
       "                                                                                                                   \n",
       "</pre>\n"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 19
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T19:28:25.164767Z",
     "start_time": "2025-03-16T19:28:25.138039Z"
    }
   },
   "cell_type": "code",
   "source": "intc_xbrl.render_statement(\"IncomeStatement\", period_view=\"Three Recent Quarters\")",
   "id": "d3c7ae835bd478d2",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001B[3m                                          ConsolidatedStatementsofIncome                                           \u001B[0m\n",
       "\u001B[3m                              \u001B[0m\u001B[1;3mThree Months Ended\u001B[0m\u001B[3m \u001B[0m\u001B[3m(In millions, except per share data)\u001B[0m\u001B[3m                              \u001B[0m\n",
       "                                                                                                                   \n",
       " \u001B[1m \u001B[0m\u001B[1mLine Item                                                 \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mQuarterly: September 29, 2024 to December 28, 2024\u001B[0m\u001B[1m \u001B[0m \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                                                                    \n",
       "    Cost of sales                                                                                                  \n",
       "    Gross margin                                                                                                   \n",
       "    Research and development                                                                                       \n",
       "    Marketing, general, and administrative                                                                         \n",
       "    Restructuring and other charges                                                                                \n",
       "    Operating expenses                                                                                             \n",
       "    Operating income (loss)                                                                                        \n",
       "    Gains (losses) on equity investments, net                                                                      \n",
       "    Interest and other, net                                                                                        \n",
       "    Income (loss) before taxes                                                                                     \n",
       "    Provision for (benefit from) taxes                                                                             \n",
       "    Net income (loss)                                                                                              \n",
       "    Less: net income (loss) attributable to non-controlling                                                        \n",
       "  interests                                                                                                        \n",
       "    Net income (loss) attributable to Intel                                                                        \n",
       "    Earnings (loss) per share attributable to Intel—basic                                                          \n",
       "    Earnings (loss) per share attributable to Intel—diluted                                                        \n",
       "    Weighted average shares of common stock outstanding:                                                           \n",
       "      Basic (shares)                                                                                               \n",
       "      Diluted (shares)                                                                                             \n",
       "                                                                                                                   \n"
      ],
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                                          ConsolidatedStatementsofIncome                                           </span>\n",
       "<span style=\"font-style: italic\">                              </span><span style=\"font-weight: bold; font-style: italic\">Three Months Ended</span><span style=\"font-style: italic\"> (In millions, except per share data)                              </span>\n",
       "                                                                                                                   \n",
       " <span style=\"font-weight: bold\"> Line Item                                                  </span> <span style=\"font-weight: bold\"> Quarterly: September 29, 2024 to December 28, 2024 </span> \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                                                                    \n",
       "    Cost of sales                                                                                                  \n",
       "    Gross margin                                                                                                   \n",
       "    Research and development                                                                                       \n",
       "    Marketing, general, and administrative                                                                         \n",
       "    Restructuring and other charges                                                                                \n",
       "    Operating expenses                                                                                             \n",
       "    Operating income (loss)                                                                                        \n",
       "    Gains (losses) on equity investments, net                                                                      \n",
       "    Interest and other, net                                                                                        \n",
       "    Income (loss) before taxes                                                                                     \n",
       "    Provision for (benefit from) taxes                                                                             \n",
       "    Net income (loss)                                                                                              \n",
       "    Less: net income (loss) attributable to non-controlling                                                        \n",
       "  interests                                                                                                        \n",
       "    Net income (loss) attributable to Intel                                                                        \n",
       "    Earnings (loss) per share attributable to Intel—basic                                                          \n",
       "    Earnings (loss) per share attributable to Intel—diluted                                                        \n",
       "    Weighted average shares of common stock outstanding:                                                           \n",
       "      Basic (shares)                                                                                               \n",
       "      Diluted (shares)                                                                                             \n",
       "                                                                                                                   \n",
       "</pre>\n"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 18
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-16T19:45:31.018163Z",
     "start_time": "2025-03-16T19:45:30.986683Z"
    }
   },
   "cell_type": "code",
   "source": "intc_xbrl.render_statement(\"IncomeStatement\", period_view=\"YTD and Quarterly Breakdown\")",
   "id": "26afaabf2facfcb0",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001B[3m                                          ConsolidatedStatementsofIncome                                           \u001B[0m\n",
       "\u001B[3m                              \u001B[0m\u001B[1;3mNine Months Ended\u001B[0m\u001B[3m \u001B[0m\u001B[3m(In millions, except per share data)\u001B[0m\u001B[3m                               \u001B[0m\n",
       "                                                                                                                   \n",
       " \u001B[1m \u001B[0m\u001B[1mLine Item                                               \u001B[0m\u001B[1m \u001B[0m \u001B[1m \u001B[0m\u001B[1mNine Months: December 31, 2023 to September 28, 2024\u001B[0m\u001B[1m \u001B[0m \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                                                                    \n",
       "    Cost of sales                                                                                                  \n",
       "    Gross margin                                                                                                   \n",
       "    Research and development                                                                                       \n",
       "    Marketing, general, and administrative                                                                         \n",
       "    Restructuring and other charges                                                                                \n",
       "    Operating expenses                                                                                             \n",
       "    Operating income (loss)                                                                                        \n",
       "    Gains (losses) on equity investments, net                                                                      \n",
       "    Interest and other, net                                                                                        \n",
       "    Income (loss) before taxes                                                                                     \n",
       "    Provision for (benefit from) taxes                                                                             \n",
       "    Net income (loss)                                                                                              \n",
       "    Less: net income (loss) attributable to                                                                        \n",
       "  non-controlling interests                                                                                        \n",
       "    Net income (loss) attributable to Intel                                                                        \n",
       "    Earnings (loss) per share attributable to Intel—basic                                                          \n",
       "    Earnings (loss) per share attributable to                                                                      \n",
       "  Intel—diluted                                                                                                    \n",
       "    Weighted average shares of common stock outstanding:                                                           \n",
       "      Basic (shares)                                                                                               \n",
       "      Diluted (shares)                                                                                             \n",
       "                                                                                                                   \n"
      ],
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                                          ConsolidatedStatementsofIncome                                           </span>\n",
       "<span style=\"font-style: italic\">                              </span><span style=\"font-weight: bold; font-style: italic\">Nine Months Ended</span><span style=\"font-style: italic\"> (In millions, except per share data)                               </span>\n",
       "                                                                                                                   \n",
       " <span style=\"font-weight: bold\"> Line Item                                                </span> <span style=\"font-weight: bold\"> Nine Months: December 31, 2023 to September 28, 2024 </span> \n",
       " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
       "    Net revenue                                                                                                    \n",
       "    Cost of sales                                                                                                  \n",
       "    Gross margin                                                                                                   \n",
       "    Research and development                                                                                       \n",
       "    Marketing, general, and administrative                                                                         \n",
       "    Restructuring and other charges                                                                                \n",
       "    Operating expenses                                                                                             \n",
       "    Operating income (loss)                                                                                        \n",
       "    Gains (losses) on equity investments, net                                                                      \n",
       "    Interest and other, net                                                                                        \n",
       "    Income (loss) before taxes                                                                                     \n",
       "    Provision for (benefit from) taxes                                                                             \n",
       "    Net income (loss)                                                                                              \n",
       "    Less: net income (loss) attributable to                                                                        \n",
       "  non-controlling interests                                                                                        \n",
       "    Net income (loss) attributable to Intel                                                                        \n",
       "    Earnings (loss) per share attributable to Intel—basic                                                          \n",
       "    Earnings (loss) per share attributable to                                                                      \n",
       "  Intel—diluted                                                                                                    \n",
       "    Weighted average shares of common stock outstanding:                                                           \n",
       "      Basic (shares)                                                                                               \n",
       "      Diluted (shares)                                                                                             \n",
       "                                                                                                                   \n",
       "</pre>\n"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 21
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
